<script setup>
// import LayoutView from '@/components/LayoutView.vue'
import LayoutViewcopy from './components/LayoutViewcopy.vue'
import ReguserViewComm from './components/ReguserViewComm.vue'
// import { useRoute } from 'vue-router'
// const route = useRoute()
// 判断路由元信息中是否设置了需要渲染 LayoutViewcopy
// const showLayoutViewcopy = route.meta.showLayoutViewcopy
import store from '@/store/index'

const setbuttonstatus = () => {
  console.log("storedata");
  store.commit('Setbuttonstatus', false)
}
</script>

<template>
  <div class="content" @click="setbuttonstatus">
    <!-- 这里是侧边导航栏 -->
    <!-- <LayoutView></LayoutView> -->
    <!-- 这里根据路由元信息来判断是否渲染 LayoutViewcopy -->
    <div v-if="store.state.RegusterStatus" class="res">
      <ReguserViewComm class="ReguserViewComm"></ReguserViewComm>
    </div>
    <div v-if="store.state.LayoutStatus" class="res">
      <LayoutViewcopy class="layout"></LayoutViewcopy>
    </div>

    <!-- 这里是页面的正常渲染 -->
    <router-view />
  </div>
</template>

<style lang="scss" scoped>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

.content {
  position: relative;

  .res {
    position: relative;
  }

  .layout {
    width: 50px;
    height: 50px;
    position: absolute;
    top: 90%;
    left: 50%;
    bottom: 2rem;
    transform: translate(-90%, -50%);
    z-index: 999;
    position: fixed;
  }

  .ReguserViewComm {
    position: fixed;
    right: 0px;
    top: 10%;
    // background-color: #fff;
    z-index: 9;
  }
}
</style>
